#include "kiemtra.h"
void nhapchuoi(char *p,int &m)
{
	cout<<"nhap vao m";cin>>m;
	cin.ignore(1);//xoa bo nho dem
	cout<<"nhap vao chuoi:";
	cin.getline(p,m);
	for(int i=0;p[i]!='\0';i++)
	{
		cout<<p[i]<<" ";
	}
	cout<<"\n ";
}
void nhapchuoicon(char *b,int &k)
{
	cout<<"nhap vao chuoi can xoa\n";
	cout<<"nhap do dai chuoi b\n";cin>>k;

	cout<<"nhap vao chuoi:\n";
	scanf("%s",b);
	for(int i=0;b[i]!='\0';i++)
		{
			cout<<b[i]<<" ";
		}
	cout<<"\n ";
}
void xoachuoi(char *b,char *p,int k,int m)
{
	for(int i=0;i<k;i++)
	{
		for(int j=0;j<m;j++)
		{
			if(b[i]==p[j])
			{

				 for (int l=j;l<m;l++)
				 {
					 p[l]=p[l+1];
				 }
				 m--;
				 j--;
			}

		}
	}

	cout<<"chuoi sau khi xoa la:  ";
	for(int i=0;p[i]!=0;i++)
	{
		cout<<p[i];
	}

}
